﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Presentation/Department/DepHead.Master" AutoEventWireup="true" CodeBehind="AuthorityDelegation_head.aspx.cs" Inherits="ADSMS.Presentation.Department.AuthorityDelegation" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../../Design/bootstrap-datepicker.js"></script>
    <link href="../../Design/datepicker.css" rel="stylesheet" />
     <script>

         $(document).ready(function () {
             var nowTemp = new Date();
             var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);

             var checkin = $('#dpd1').datepicker({
                 format: "mm/dd/yyyy",
                 autoclose:true,
                 onRender: function (date) {
                     return date.valueOf() < now.valueOf() ? 'disabled' : '';
                 }
             }).on('changeDate', function (ev) {
                 if (ev.date.valueOf() > checkout.date.valueOf()) {
                     var newDate = new Date(ev.date)
                     newDate.setDate(newDate.getDate() + 1);
                     checkout.setValue(newDate);
                 }
                 checkin.hide();
                 $('#dpd2')[0].focus();
             }).data('datepicker');
             var checkout = $('#dpd2').datepicker({
                 format: "mm/dd/yyyy",
                 autoclose: true,
                 onRender: function (date) {
                     return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : '';
                 }
             }).on('changeDate', function (ev) {
                 checkout.hide();
             }).data('datepicker');
         });

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="container">
        <div class="jumbotron">
            <div class="row">

                <asp:Panel ID="PanelError" runat="server" CssClass="alert alert-dismissable alert-danger" Visible="False">
                    <strong>Sorry! </strong>There is no data. Please, redo your transactions.
                </asp:Panel>

                <asp:Panel ID="PanelErrorSave" runat="server" CssClass="alert alert-dismissable alert-danger" Visible="False">
                    <strong>Sorry! </strong><asp:Label ID="lblErrorSave" runat="server" Text=""></asp:Label>
                </asp:Panel>
      
                <asp:Panel ID="PanelSubmit" runat="server" CssClass="alert alert-dismissable alert-success" Visible="False">
                    <strong>Delegated! </strong>This delegation has been delegated. <asp:Label ID="lblDelegated" runat="server" Text=""></asp:Label>
                </asp:Panel>

                <asp:Panel ID="PanelCancel" runat="server" CssClass="alert alert-dismissable alert-success" Visible="False">
                    <strong>Canceled! </strong>This delegation has been canceled.</asp:Panel>

                <div class="col-lg-6">
                    <div class="well">



                        <div class="bs-example form-horizontal">
                            <fieldset>
                                <legend>Authorise Delegation Form</legend>

                                <div class="form-group">
                                    <asp:Label ID="delegateAuthoritylbl" runat="server" Text="Delegate Authority To:" CssClass="col-lg-4 control-label"></asp:Label>
                                    <div class="col-lg-6">

                                        <asp:DropDownList ID="ddlEmpName" CssClass="form-control" runat="server" DataTextField="EmployeeName" DataValueField="EmployeeID" AutoPostBack="True" OnSelectedIndexChanged="EmpName_SelectedIndexChanged">
                                        </asp:DropDownList>
                                    </div>
                                    <br />
                                </div>
                                <div class="form-group">
                                    <asp:Label ID="EmpIDlbl" runat="server" Text="Employee's ID:" CssClass="col-lg-4 control-label"></asp:Label>
                                    <div class="col-lg-6">
                                        <asp:TextBox ID="txtEmpID" CssClass="form-control" runat="server" Enabled="False"></asp:TextBox>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <asp:Label ID="empContactlbl" runat="server" Text="Employee Contact Number:" CssClass="col-lg-4 control-label"></asp:Label>
                                    <div class="col-lg-6">
                                        <asp:TextBox ID="txtEmpContact" CssClass="form-control" runat="server" Enabled="False"></asp:TextBox>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <asp:Label ID="fromDatelbl" runat="server" Text="From Date:" CssClass="col-lg-4 control-label"></asp:Label>
                                    <div class="col-lg-6">
                                        <input id="dpd1" name="dpd1" type="text" value="<%= this.FromDate %>" required pattern="^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$" placeholder="From date" class="form-control"/>
                                        
                                       <%-- <asp:TextBox ID="fromDateTextBox" CssClass="form-control" runat="server"></asp:TextBox>
                                        <asp:ImageButton ID="imgbtnCalendar" runat="server" Height="30px"
                                            ImageUrl="~/Images/calendar.png" OnClick="imgbtnCalendar_Click" />
                                        <asp:Calendar ID="Calendar1" runat="server"
                                            OnSelectionChanged="Calendar1_SelectionChanged" Visible="False"></asp:Calendar>--%>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <asp:Label ID="toDatelbl" runat="server" Text="To Date:" CssClass="col-lg-4 control-label"></asp:Label>
                                    <div class="col-lg-6">
                                        <input id="dpd2" name="dpd2" type="text" value="<%= this.ToDate %>" required pattern="^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)\d\d$" placeholder="To date" class="form-control"/>
                                        <%--<asp:TextBox ID="toDateTextBox" runat="server" CssClass="form-control"></asp:TextBox>
                                        <asp:ImageButton ID="imgbtnCalendar2" runat="server" Height="30px"
                                            ImageUrl="~/Images/calendar.png" OnClick="imgbtnCalendar2_Click" />
                                        <asp:Calendar ID="Calendar2" runat="server"
                                            OnSelectionChanged="Calendar2_SelectionChanged" Visible="False"></asp:Calendar>--%>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-lg-10 col-lg-offset-4">
                                        <asp:Button ID="btnSubmitDeligation" runat="server" Text="Submit Delegation" CssClass="btn btn-primary" OnClick="btnSubmitDeligation_Click" Enabled="False" />
                                        <asp:Button ID="btnResetDelegation" runat="server" Text="Cancel Delegation" CssClass="btn btn-default" OnClick="btnResetDelegation_Click" Enabled="False" />
                                    </div>
                                </div>
                            </fieldset>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>

